<%@page import="model.entity.Branch"%>
<%@page import="model.entity.Category"%>
<%@page import="model.BranchProductImp"%>
<%@page import="java.util.List"%>
<%@page import="model.*"%>
<%@page import="model.entity.Account"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<div class="tab_container">
    <div id="tab2" class="tab_content" style="display: block;">
        <h2>Add product to Branch</h2>

        <p>
<%
    if(request.getAttribute("messageaddtobranch") != null)
               {
%>
<div class="notification failure canhide">
            
                <p><strong>FAILURE: </strong>
                click me and I'll go away and hide again.</p>                
            </div>
<%}%>
        </p>
<%
    int productid = (Integer)request.getAttribute("productid");
    ProductImp pim = new ProductImp();
    List<Branch> listb = (List<Branch>)request.getAttribute("listbranch");
%>
        <form action="<c:url value="<%= "/admin/branchproduct/add" %>"/>" method="POST" >
            <p>
                <label>Product Name: <%= pim.DetailProduct(productid).getProductname() %> </label><br/>
                <input type="hidden" class="text small" name="sanphamid" value="<%= productid %>" > 
        
            </p>
            
            <label for="cbo">Select Branch:</label>

            <select name="branchid" id="cbo" class="select">
<%
    for(Branch list : listb)
               {
%>
                <option value="<%= list.getBranchid() %>"><%= list.getBranchname() %> </option>
<%}%>
            </select>   

       
            <p>
                <input type="submit" class="submit" value="Submit">
            </p>

        </form>

    </div>
</div>